package cn.ncu.wechat.dao;

import cn.ncu.wechat.model.Orders;
import cn.ncu.wechat.model.dto.OrderDTO2;
import cn.ncu.wechat.model.dto.VerificationDTO;
import cn.ncu.wechat.model.dto.VerificationsDTO;
import cn.ncu.wechat.vo.OrderVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
* @author 
* @description 针对表【order(订单表)】的数据库操作Mapper
* @createDate 2025-01-07 16:15:26
* @Entity cn.ncu.wechat.modle.Orders
*/
public interface OrdersMapper extends BaseMapper<Orders> {

    List<OrderVo> getOrderListByKey(OrderDTO2 orderVo);
    Page<OrderVo> getOrderByUId(Page<OrderVo> page,Integer status,Long id);

    Page<VerificationDTO> getOrderListForVif(Page<VerificationDTO> page, String orderNo,String startDate,String endDate,Integer storeId);

    @Select("select o.product_name as productName, s.name as storeName " +
            "from orders o " +
            "join store s on s.id = #{storeId} " +
            "where o.order_no = #{orderNo}")
    Map<String, String> getStoreNameAndProductNameByOrder(Long storeId,String orderNo);
}




